<template>
  <div>
    <h3>表格</h3>
    <ul>
      <li v-for="({ id, name, age }, index) in users" :key="id">
        <span>{{ name }}</span> -- <span>{{ age }}</span> --
        <button @click="editUser(index)">修改</button>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  props: ['users'],
  methods: {
    editUser(index) {
      this.$emit('editUser', index)
    }
  }
}
</script>

<style lang="scss" scoped></style>
